const os = require('os')

const netData = os.networkInterfaces()

const netItems = []

for (const name in netData) {
  const ipv4Item = netData[name].find(i => i.family === 'IPv4')
  if (ipv4Item.internal === false) {
    netItems.push({
      name,
      address: ipv4Item.address
    })
  }
}

console.log(netItems)